package com.piece.module.flowable.model;

import com.piece.core.framework.annotation.translate.DicTranslate;
import com.piece.core.framework.support.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Entity
@NoArgsConstructor
@Table(name = "wf_copy")
@ApiModel(value = "流程抄送表:wf_copy")
public class WfCopy extends BaseEntity implements Serializable {

    @Id
    @Column(name = "copy_id", length = 11)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "抄送主键")
    private Long copyId;

    @Column(name = "title", length = 255)
    @ApiModelProperty(value = "抄送标题")
    private String title;

    @Column(name = "process_id", length = 64)
    @ApiModelProperty(value = "流程主键")
    private String processId;

    @Column(name = "process_name")
    @ApiModelProperty(value = "流程名称")
    private String processName;

    @Column(name = "category_id", length = 11)
    @ApiModelProperty(value = "流程分类主键")
    private String categoryId;

    @Column(name = "deployment_id", length = 64)
    @ApiModelProperty(value = "部署主键")
    private String deploymentId;

    @Column(name = "instance_id", length = 64)
    @ApiModelProperty(value = "流程实例主键")
    private String instanceId;

    @Column(name = "task_id", length = 64)
    @ApiModelProperty(value = "任务主键")
    private String taskId;

    @Column(name = "user_id", length = 11)
    @ApiModelProperty(value = "用户主键")
    private String userId;

    @Transient
    @DicTranslate(target = "userId", proxy = "tbSysUserService.convertIdToName")
    @ApiModelProperty(value = "用户名")
    private String userName;

    @Column(name = "originator_id", length = 11)
    @ApiModelProperty(value = "发起人Id")
    private String originatorId;

    @Column(name = "originator_name", length = 30)
    @ApiModelProperty(value = "发起人名称")
    private String originatorName;

    @Column(name = "status", length = 1)
    @ApiModelProperty(value = "状态", notes = "0=正常, 1=删除, 2=停用")
    private String status;

    @Transient
    @ApiModelProperty(value = "状态")
    @DicTranslate(source = "status", dicType = "sys_normal_disable")
    private String statusName;
}
